﻿using System.Windows;
using System.Windows.Input;
using GalaSoft.MvvmLight.Messaging;
using MicroMvvm;

namespace Example.ViewModel
{
    class EventPanelViewModel
    {

        public static string AlertMessageToken = "ViewAlert";


        // 普通 键盘命令 
        public RelayCommand OnKeyAltQCommand => new RelayCommand(OnAltQ);

        // 普通 鼠标命令
        public RelayCommand OnLeftDoubleClickCommand => new RelayCommand(OnLeftDoubleClick);

        // 弹出一个警告窗口的消息
        public RelayCommand ShowAlertMsgCommand => new RelayCommand(SendAlterMessage);


        private void OnAltQ()
        {
            MessageBox.Show("Key Alt + Q");
        }

        private void OnLeftDoubleClick()
        {
            MessageBox.Show("LeftDoubleClick- Double Kill");
        }

        private void SendAlterMessage()
        {
            Messenger.Default.Send<string>("ViewModel里面传出来的警告消息内容。", AlertMessageToken);
        }


    }
}
